#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
using PII = pair<int, int>;
const int N = 2e5 + 10;

int n;
PII q[N];

void solve(){
    cin >> n;

    for(int i = 1, x; i <= n; i ++){
        cin >> x;
        q[i] = {x, i};
    }

    sort(q + 1, q + n + 1);

    int fo = 0;
    for(int i = 1; i <= n; i ++){
        if(q[i].second == 1){
            fo = i;
            break;
        }
    }

    for(int i = fo; i <= n; i ++){
        if(q[fo].first < q[i].first){
            int k = q[i].first - q[fo].first;
            int tp = (k + 1) / 2;
            q[i].first -= tp;
            q[fo].first += tp;
        }
    }

    cout << q[fo].first << '\n';
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        solve();
    }


    return 0;
}